<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: Mr_xcq
  Date: 2018/11/29
  Time: 15:18
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>详情 List</title>
    <style>
        div ul  li {
            display: inline-block;
            list-style: none;
        }
        div ul li .current {
            border: 1px solid #fff;
        }
        div ul li.current a {
            color: #3e3e3e;
            font-weight: bold;
        }
    </style>
</head>
<body>
<br>
<br>
<h3>查询条件</h3>
<form action="/staff/list" method="post">
    员工姓名：<input type="text" name="staff_name" value="${condition.staffName}"> 员工编号： <input type="text" name="staff_num" value="${condition.staffNum}"> 员工部门： <input type="text" name="staff_department" value="${condition.staffDepartment}"> 入职时间： <input type="date" name="joined_time" value="${condition.joinedTime}">
    <input type="submit" value="查询">
</form>
<a href="/staff/updateandaddpage"><button type="button">新增</button></a>
<br>
<br>
<br>
<table>
    <caption>员工信息表</caption>
    <tr>
        <td>员工编号</td><td>员工姓名</td><td>员工部门</td><td>员工性别</td><td>员工年龄</td><td>员工体重</td><td>员工身高</td><td>入职时间</td><td>操作</td>
    </tr>

    <c:forEach items="${staffs}" var="staff">
        <tr>
            <td>${staff.staffNum}</td><td>${staff.staffName}</td><td>${staff.staffDepartment}</td><td>${staff.staffGender}</td><td>${staff.staffAge}</td>
            <td>${staff.staffWeight}</td><td>${staff.staffHeight}</td><td>${staff.joinedTime}</td><td><a href="/staff/delete?id=${staff.id}">删除</a>|<a href="/staff/updateandaddpage?id=${staff.id}">修改</a></td>
        </tr>
    </c:forEach>
</table>
<div>
<ul>
    <li><a href="/staff/list?staff_name=${condition.staffName}& staff_num=${condition.staffNum}&staff_department=${condition.staffDepartment}&joined_time = ${condition.joinedTime}&current_page=1">首页</a></li>
    <c:if test="${page.currentPage >1 }">
        <li><a href="/staff/list?staff_name=${condition.staffName}& staff_num=${condition.staffNum}&staff_department=${condition.staffDepartment}&joined_time = ${condition.joinedTime}&current_page=${page.currentPage -1 }">上一页</a></li>
    </c:if>
    <c:forEach begin="1" end="${pageResult.totalPage}" var="index">
        <li <c:if test="${page.currentPage == index }"> class="current" </c:if> ><a href="/staff/list? staff_name=${condition.staffName}& staff_num=${condition.staffNum}&staff_department=${condition.staffDepartment}&joined_time = ${condition.joinedTime}&current_page=${index}">${index}</a></li>
    </c:forEach>
    <c:if test="${page.currentPage < pageResult.totalPage }">
        <li><a href="/staff/list?staff_name=${condition.staffName}& staff_num=${condition.staffNum}&staff_department=${condition.staffDepartment}&joined_time = ${condition.joinedTime}&current_page=${page.currentPage +1 }">下一页</a></li>
    </c:if>
    <li><a href="/staff/list?staff_name=${condition.staffName}& staff_num=${condition.staffNum}&staff_department=${condition.staffDepartment}&joined_time = ${condition.joinedTime}&current_page=${pageResult.totalPage}">末页</a></li>
    <li>共${pageResult.totalPage}页</li>
    <li>共${pageResult.totalNum}条</li>
</ul>
</div>
</body>
</html>
